#ifndef _TIMER_H_
#define _TIMER_H_


#ifdef _WIN32
//! \brief	    Maps the windows 64 bit integer to a uniform name
typedef __int64 i64 ;
#else
//! \brief	    Maps the linux 64 bit integer to a uniform name
typedef long long i64;
#endif


//////////////////////////////////////////////////////////////////////////
//!
//! \brief	Timer that provides a fairly accurate timing mechanism for 
//!         both windows and linux. 
//!
//! \warning Not thread safe. 
//!
//////////////////////////////////////////////////////////////////////////
class Timer {
public:
    Timer();
    ~Timer();
    void start(void);
    void stop(void);
    void reset(void);
    double getElapsedTime(void);
private:
    //! \brief	Stores the CPU frequency.
    i64 _freq;
    //! \brief	Stores the time has elapsed.
    i64 _clocks;
    //! \brief	Stores the starting time.
    i64 _start;
};


#endif // _TIMER_H_

